package xyz.xmh.pattern.creational.builderpattern;

import xyz.xmh.pattern.creational.builderpattern.entity.ChickenBurger;
import xyz.xmh.pattern.creational.builderpattern.entity.Coke;
import xyz.xmh.pattern.creational.builderpattern.entity.Pepsi;
import xyz.xmh.pattern.creational.builderpattern.entity.VegBurger;

/**
 * MealBuilder
 * 套餐建造类
 *
 * @author xuMingHai
 * @since 2021/4/29 星期四 11:38
 */
public class MealBuilder {

    /**
     * 套餐一
     *
     * @return 套餐一
     */
    public Meal meal1() {
        // 创建套餐对象
        Meal meal = new Meal();
        // 添加蔬菜汉堡
        meal.addItem(new VegBurger());
        // 添加可乐
        meal.addItem(new Coke());
        return meal;
    }

    /**
     * 套餐二
     *
     * @return 套餐二
     */
    public Meal meal2() {
        Meal meal = new Meal();
        meal.addItem(new ChickenBurger());
        meal.addItem(new Pepsi());
        return meal;
    }
}
